var t = getApp();

Page({
    data: {
        worker_id: ""
    },
    onLoad: function(t) {
        t.worker_id && this.setData({
            worker_id: t.worker_id
        }), this.getData();
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    addTime: function(t) {
        var e = t.currentTarget.dataset.item;
        e ? wx.navigateTo({
            url: "/packageE/appointment/technician/work_day/TechnicianTime/TechnicianTime?worker_id=" + this.data.worker_id + "&item=" + JSON.stringify(e)
        }) : wx.navigateTo({
            url: "/packageE/appointment/technician/work_day/TechnicianTime/TechnicianTime?worker_id=" + this.data.worker_id
        });
    },
    getTime: function(e) {
        console.log(e);
        var o = e.currentTarget.dataset.item, a = e.currentTarget.dataset.ind;
        if (o.show) return o.show = !1, this.data.store[a] = o, void this.setData({
            store: this.data.store
        });
        var n = o.id, i = this, r = t.getNetAddresss("plugin.appointment.frontend.appointment-service.get-by-worker");
        t._getNetWork({
            url: r,
            data: {
                store_id: n,
                worker_id: i.data.worker_id
            },
            success: function(t) {
                var e = t.data;
                1 == e.result ? (console.log(e), o.show = !0, o.times = e.data, i.data.store[a] = o, 
                i.setData({
                    store: i.data.store
                }), console.log(i.data.store)) : (wx.showToast({
                    title: e.msg,
                    icon: "none"
                }), console.log(e.msg));
            }
        });
    },
    getData: function() {
        var e = this, o = t.getNetAddresss("plugin.appointment.frontend.store.get-list-by-worker-uid");
        t._getNetWork({
            url: o,
            success: function(t) {
                var o = t.data;
                1 == o.result ? (console.log(o), e.setData({
                    store: o.data
                }), console.log(e.data.store)) : (wx.showToast({
                    title: o.msg,
                    icon: "none"
                }), console.log(o.msg));
            }
        });
    }
});